package com.framework.service.impl;

import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.framework.dao.DeptSmsInfoDao;
import com.framework.entity.sys.SysDeptSmsInfo;
import com.framework.exception.RRException;
import com.framework.exception.menu.RespCode;
import com.framework.page.PageUtils;
import com.framework.service.DeptSmsInfoService;
import com.framework.validator.Assert;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * 功能描述: 短信模板详情
 *
 * @author ck
 * @date 2018/9/3 13:29
 */
@Service("deptSmsInfoService")
public class DeptSmsInfoServiceImpl extends ServiceImpl<DeptSmsInfoDao, SysDeptSmsInfo> implements DeptSmsInfoService {

	@Override
	public PageUtils queryPage(Map<String, Object> params) {
		return null;
	}

	@Override
	public SysDeptSmsInfo queryDeptSmsInfo(Long smsId, String smsType) {
		if(smsId == null || smsId == 0){
			throw new RRException(RespCode.NOT_PARAM_ERROR);
		}
		Assert.isBlank(smsType, "短信类型不能为空");
		SysDeptSmsInfo s = new SysDeptSmsInfo();
		s.setSmsType(smsType);
		s.setSmsId(smsId);
		return baseMapper.selectOne(s);
	}
}
